-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-numeric strings in pow() lead to error #2796
Conversation
This pull request has been marked as ready for review. |
7b2ac0c
to
86acced
Compare
src/Type/ExponentiateHelper.php
Outdated
new NullType(), | ||
]); | ||
if (!$allowedOperandTypes->isSuperTypeOf($exponent)->yes()) { | ||
return new ErrorType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with returning ErrorType here.
string
might still be a numeric-string
so it's wrong to return ErrorType for that case.
We just want to prevent the internal error the issue is about.
reduced the PR to a minimal fix |
Thank you. |
closes phpstan/phpstan#10125